home *** CD-ROM | disk | FTP | other *** search
- /*
- File: USBTabletModule.h
-
- Contains: Header file for Wacom module
-
- Version: xxx put version here xxx
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
-
- */
- #ifndef __WacomModuleH__
- #define __WacomModuleH__
-
- #include <Types.h>
- #include <Devices.h>
- #include <DriverServices.h>
- #include <Processes.h>
- #include <CursorDevices.h>
- #include <USB.h>
-
- OSStatus WacomDriverValidateHW(USBDeviceRef device, USBDeviceDescriptor *desc);
- OSStatus WacomDeviceInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
- OSStatus WacomInterfaceInitialize(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device);
- OSStatus WacomDriverFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc);
- OSStatus WacomDriverNotifyProc(UInt32 notification, void *pointer, UInt32 refCon);
-
- OSStatus API_InstallInterrupt(HIDInterruptProcPtr HIDInterruptFunction, UInt32 refcon);
- OSStatus API_PollDevice(void);
- OSStatus API_GetDeviceInfo(UInt32 theInfoSelector, void * theInfo);
- OSStatus API_EnterPolledMode(void);
- OSStatus API_ExitPolledMode(void);
- OSStatus API_ControlDevice(UInt32 theControlSelector, void * theControlData);
-
-
- Boolean immediateError(OSStatus err);
-
- void InitiateTransactionProc(USBPB *pb);
- void TransactionCompletionProc(USBPB *pb);
-
- void DeviceInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDeviceDescriptor, UInt32 busPowerAvailable);
- void ProcessInterruptReport(UInt32 devicetype, UInt8 hidReport[]);
-
- void NotifyCursorDeviceManager(UInt32 refcon, void * theData);
- void InitParamBlock(USBDeviceRef theDeviceRef, USBPB * paramblock);
-
- #define kWacomRetryCount 3
-
- enum driverstages
- {
- kUndefined = 0,
- kFindInterface,
- kOpenDevice,
- kNewInterfaceRef,
- kConfigureInterface,
- kSetProtocol,
- kGetReportDescriptor,
- kFindInterruptPipe,
- kReadInterruptPipe,
- kReturnFromDriver = 0x1000,
- kRetryTransaction = 0x2000,
- kSyncTransaction = 0x4000,
- kCompletionPending = 0x8000
- };
-
-
- typedef struct
- {
- UInt8 spare;
- UInt16 xPosition;
- UInt16 yPosition;
- UInt8 buttons;
- UInt8 pressure;
-
- } WacomReport;
-
- typedef struct
- {
- USBPB pb;
- void (*handler)(USBPB *pb);
-
- UInt32 refcon;
-
- UInt32 interfaceNumber;
- UInt32 configurationNumber;
-
- USBDeviceRef deviceRef;
- USBInterfaceRef interfaceRef;
- USBPipeRef pipeRef;
-
- UInt32 hidReportSize;
- UInt8 hidReport[255];
- UInt8 hidReportDescriptor[255];
-
- HIDInterruptProcPtr pSHIMInterruptRoutine;
- HIDInterruptProcPtr pSavedInterruptRoutine;
-
- SInt32 retryCount;
- SInt32 transDepth;
-
- CursorDevicePtr pCursorDeviceInfo;
- CursorDevice cursorDeviceInfo;
- Fixed unitsPerInch;
- UInt32 busPowerAvailable;
-
- } usbWacomPBStruct;
-
- #endif //__WacomModuleH__